﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Obligatorio2013.Clases
{
    public class Category
    {


        #region atributes
        public static long startNum = 1000;
        private void generateCatId()
        {
            //this.CatId = ++Category.startNum;
            this.CatId = new Random().Next();
        }
        #endregion


        #region Properties
       
        public string Name { get; set; }
        public List<string> KeyWords{ get; set; }
        public long CatId { get; set; }
        #endregion

        #region Consutructors
        public Category(string name, List<string> k) 
        {
            this.generateCatId();
            this.Name = name;
            this.KeyWords = k;
        }

        public Category() { }
        #endregion

        #region methods

        public override bool Equals(object obj)
        {
            Category otherCat = obj as Category;
            return this.CatId == otherCat.CatId;
        }
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
        public override string ToString()
        {
            return this.Name;
        }
        #endregion
        
    }
}